package svc.elib.db;

import java.io.IOException;
import java.util.Scanner;

public class Explorer {

	public static void main(String[] args) 
		throws IOException
	{
		Database db = new Database("eLibData.csv", 1932, 2011);
		Scanner in = new Scanner(System.in);
		
		while (true) {
			System.out.println("Enter first name (or exit): ");
			String firstName = in.nextLine();
			if (firstName.compareTo("exit") == 0)
				break;
			
			System.out.println("Enter last name: ");
			String lastName = in.nextLine();
			
			System.out.println("Searching for author <<<" + firstName + " " + lastName + ">>>");
			
			Author a = db.searchAuthor(firstName, lastName);
			if (a != null) {
				a.printFullInfo();
			} else {
				System.out.println("Author does not exsist");
			}
		}
		
		in.close();
	}
	
}
 